import _ from 'lodash';
import './style/style.css';
import PrintMe from './print'
import Icon from './222.jpg'
 function component() {
    const element = document.createElement('div');
    const btn = document.createElement('button')
  // lodash 在当前 script 中使用 import 引入
   element.innerHTML = _.join(['Hello', 'World','俺是最帅滴'], ' ');
   element.classList.add('hello');
   btn.innerHTML = 'Click me and check the console!';
   btn.onclick = PrintMe;
 
   element.appendChild(btn);
   //将图片添加到我们已经存在的div中
   const myIcon = new Image();
   myIcon.src = Icon;
   element.appendChild(myIcon)
   return element;
 }

 document.body.appendChild(component());